//
//  BlueButton.m
//  RedHareCar
//
//  Created by WDL on 16/12/29.
//  Copyright © 2016年 CarCredit. All rights reserved.
//

#import "BlueButton.h"
#import "UIImage+Extension.h"
@implementation BlueButton

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self commonInit];
    }
    return self;
}

-(void)commonInit{
    
    self.layer.cornerRadius  = 5;
    self.layer.masksToBounds = YES;
    self.titleLabel.font = font(18);
    self.titleLabel.textColor = UIColorFromRGB(0xffffff);
    self.backgroundColor = ClearColor;
    
    [self setBackgroundImage:[UIImage resizableImageWithName:@"button-front"] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage resizableImageWithName:@"button-after"] forState:UIControlStateHighlighted];
    [self setBackgroundImage:[UIImage resizableImageWithName:@"button-front"] forState:UIControlStateDisabled];
    
}

-(void)awakeFromNib{
    [super awakeFromNib];
    [self commonInit];
    
}
@end
